import { createStore } from 'vuex'

export default createStore({
  state: {
    todoList: [] as string[],
    doneList: [] as string[],
    delList: [] as string[]
  },
  mutations: {
    addList (state, value) {
      state.todoList.push(value)
    },
    delList (state, index) {
      const item = state.todoList[index]
      state.todoList.splice(index, 1)
      state.delList.push(item)
    },
    doneList (state, index) {
      const item = state.todoList[index]
      state.todoList.splice(index, 1)
      state.doneList.push(item)
    }
  },
  actions: {
  },
  modules: {
  }
})
